# Start from a Java image.
FROM 192.168.59.250/choosefine/java:latest

# Rocketmq version
ENV ROCKETMQ_VERSION 4.1.0-incubating

# Rocketmq home
ENV ROCKETMQ_HOME  /opt/rocketmq-${ROCKETMQ_VERSION}
ENV JAVA_HOME /opt/jdk1.8.0_111

WORKDIR  ${ROCKETMQ_HOME}

RUN mkdir -p \
		/opt/logs \
		/opt/store

ADD rocketmq-all-4.1.0-incubating ${ROCKETMQ_HOME}
#RUN  unzip rocketmq.zip \
#          && mv apache-rocketmq-all/* . \
#          && rmdir apache-rocketmq-all  \
#          && rm rocketmq.zip


RUN chmod +x bin/mqnamesrv

CMD cd ${ROCKETMQ_HOME}/bin && export JAVA_OPT=" -Duser.home=/opt" && sh mqnamesrv


EXPOSE 9876
VOLUME /opt/logs \
		/opt/store

